home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1998 August / PC Direct August 1998.iso / S / powerj / Product / hpp.z / WCONSOLE.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  4.0 KB  |  170 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. #ifndef _WCONSOLE_HPP_INCLUDED
  12. #define _WCONSOLE_HPP_INCLUDED
  13. #pragma once
  14.  
  15. #ifndef _WNO_PRAGMA_PUSH
  16. #pragma pack(push,8);
  17. #pragma enum int;
  18. #endif
  19.  
  20. #include <conio.h>
  21. #include <stdio.h>
  22.  
  23. #include "wdef.hpp"
  24.  
  25. #ifndef _WOBJECT_HPP_INCLUDED
  26. #include "wobject.hpp"
  27. #endif
  28. #ifndef _WCOLOR_HPP_INCLUDED
  29. #include "wcolor.hpp"
  30. #endif
  31. #ifndef _WSTRING_HPP_INCLUDED
  32. #include "wstring.hpp"
  33. #endif
  34.  
  35.  
  36. class WCMCLASS WConsole : public WObject {
  37.     WDeclareSubclass( WConsole, WObject );
  38.  
  39.     public:
  40.  
  41.         /**********************************************************
  42.          * Constructors and Destructors
  43.          *********************************************************/
  44.         
  45.         WConsole();
  46.  
  47.         ~WConsole();
  48.  
  49.         /**********************************************************
  50.          * Properties
  51.          *********************************************************/
  52.  
  53.         // BackColor
  54.  
  55.         virtual WBool SetBackColor( const WColor & color );
  56.         virtual WColor GetBackColor();
  57.  
  58.         // CodePage
  59.  
  60.         WBool SetCodePage( WUInt codePage );
  61.         WUInt GetCodePage();
  62.  
  63.         // Columns
  64.  
  65.         WBool SetColumnCount( WUShort columns );
  66.         WUShort GetColumnCount();
  67.  
  68.         // CursorPosition
  69.  
  70.         WBool SetCursorPosition( const WPoint & position );
  71.         WPoint GetCursorPosition();
  72.  
  73.         // CursorSize
  74.  
  75.         WBool SetCursorSize( WUShort size );
  76.         WUShort GetCursorSize();
  77.  
  78.         // CursorVisible
  79.  
  80.         WBool SetCursorVisible( WBool visible );
  81.         WBool GetCursorVisible();
  82.  
  83.         // EchoInput
  84.  
  85.         WBool SetEchoInput( WBool onOff );
  86.         WBool GetEchoInput();
  87.  
  88.         // ForeColor
  89.  
  90.         virtual WBool SetForeColor( const WColor & color );
  91.         virtual WColor GetForeColor();
  92.  
  93.         // LineInput
  94.  
  95.         WBool SetLineInput( WBool onOff );
  96.         WBool GetLineInput();
  97.  
  98.         // MaximumColumns
  99.  
  100.         WUShort GetMaximumColumns();
  101.  
  102.         // MaximumRows
  103.  
  104.         WUShort GetMaximumRows();
  105.  
  106.         // Rows
  107.  
  108.         WBool SetRowCount( WUShort rows );
  109.         WUShort GetRowCount();
  110.  
  111.         // Text
  112.  
  113.         virtual WBool SetText( const WString & str );
  114.         virtual WString GetText();
  115.  
  116.         /**********************************************************
  117.          * Methods
  118.          *********************************************************/
  119.  
  120.         // Create
  121.  
  122.         WBool Create();
  123.  
  124.         // Clear
  125.  
  126.         WBool Clear();
  127.  
  128.         // Destroy
  129.  
  130.         virtual WBool Destroy();
  131.  
  132.         // Flush
  133.  
  134.         WBool Flush();
  135.  
  136.         // Read
  137.  
  138.         WBool Read( WString & buffer );
  139.  
  140.         // RedirectSTDIO
  141.  
  142.         WBool RedirectSTDIO( WBool onOff );
  143.  
  144.         // Write
  145.  
  146.         WBool Write( const WString & buffer );
  147.         
  148.         /**********************************************************
  149.          * Data
  150.          *********************************************************/
  151.          
  152.     private:
  153.         WColor          _backColor;
  154.         WULong          _foreColorAttr;
  155.         WColor          _foreColor;
  156.         WULong          _backColorAttr;
  157.         WBool           _IORedirected;
  158.         FILE            _oldSTDIn;
  159.         FILE            _oldSTDOut;
  160.         FILE            _oldSTDErr;
  161. };
  162.  
  163.  
  164. #ifndef _WNO_PRAGMA_PUSH
  165. #pragma enum pop;
  166. #pragma pack(pop);
  167. #endif
  168.  
  169. #endif // _WCONSOLE_HPP_INCLUDED
  170.